package com.ruoyi.web.controller.warning;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.warning.domain.entity.WirelessBoard;
import com.ruoyi.warning.service.IWirelessBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 无线画板表 前端控制器
 * </p>
 *
 * @author chenhc
 * @since 2025-10-22
 */
@RestController
@RequestMapping("/wirelessBoard")
@Api(tags = "无线画板", description = "用于处理画板位置相关操作的控制器")
public class WirelessBoardController {
    @Resource
    private IWirelessBoardService wirelessBoardService;

    @ApiOperation("list")
    //@PreAuthorize("@ss.hasPermi('system:config:export')")
    @GetMapping(value = "/list")
    public R list()
    {
        List<WirelessBoard> list = wirelessBoardService.list();
        return R.ok(list);
    }

    @ApiOperation("增加或修改")
    //@PreAuthorize("@ss.hasPermi('system:config:export')")
    @PostMapping(value = "/saveOrUpdate")
    public R saveOrUpdate(@RequestBody WirelessBoard wirelessBoard){
        wirelessBoardService.saveOrUpdate(wirelessBoard);
        return R.ok();
    }

    @ApiOperation("删除")
    //@PreAuthorize("@ss.hasPermi('system:config:export')")
    @DeleteMapping(value = "/delete/{id}")
    public R delete(@PathVariable Long id){
        wirelessBoardService.removeById(id);
        return R.ok();
    }
}
